package com.zff.rental.mapstruct.apartment;


import com.zff.rental.entity.apartment.DeviceDictEntity;
import com.zff.rental.mapstruct.BaseMapstruct;
import com.zff.rental.vo.apartment.deviceDict.AddDeviceDictParams;
import com.zff.rental.vo.apartment.deviceDict.DeviceDictVo;
import com.zff.rental.vo.apartment.deviceDict.ModifyDeviceDictParams;
import org.mapstruct.*;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @author HCY
 */
@Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface DemoMapstruct extends BaseMapstruct {
    DemoMapstruct INSTANCE = Mappers.getMapper(DemoMapstruct.class);

    DeviceDictVo map(DeviceDictEntity findResult);

    DeviceDictEntity map(AddDeviceDictParams params);

    @Mapping(target = "id", ignore = true)
    @BeanMapping(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
    void merge(@MappingTarget DeviceDictEntity target, ModifyDeviceDictParams source);

    List<DeviceDictVo> mapAsList(List<DeviceDictEntity> records);
}
